﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:local="clr-namespace:CountJobTags"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!-- Makes it easier to put a bullet into a textblock -->
    <ControlTemplate x:Key="BulletTemplate" TargetType="{x:Type ContentControl}">
        <BulletDecorator>
            <BulletDecorator.Bullet>
                <Ellipse Fill="MidnightBlue" Stroke="Yellow" StrokeThickness="1" Width="8" Height="8"/>
            </BulletDecorator.Bullet>
        </BulletDecorator>
    </ControlTemplate>
    
    <!-- Common settings for main buttons -->
    <Style x:Key="MainButtonStyle" TargetType="Button">
        <Setter Property="FontSize" Value="14" />
        <Setter Property="Height" Value="30" />
        <Setter Property="Margin" Value="3" />
        <Setter Property="Padding" Value="2" />
    </Style>

    <!-- This stye animates the textblock, it flashes the color to yellow 3 times and slides the text 25 pixels.
         Apparently animating the text foreground is extremely difficult.   -->
    <Style x:Key="AnimatedTextBlockStyle" TargetType="{x:Type TextBlock}">
        <!-- If I don't supply this, I apparently can't animiate it -->
        <Setter Property="RenderTransform">
            <Setter.Value>
                <TranslateTransform x:Name="txTnsTnf" />
            </Setter.Value>
        </Setter>
        <!-- If I don't supply this, I apparently can't animiate it -->
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="Transparent" />
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.EnableAnimations}" Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard Name="AnimateTextbox">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetProperty="(TextBlock.RenderTransform).(TranslateTransform.X)" Duration="0:0:0.5"
                                                 From="25" To="0" />
                            <ColorAnimation Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)" From="White" To="Yellow" 
                                            Duration="00:00:0.5" RepeatBehavior="3x" AutoReverse="True" />
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.EnterActions>
            </DataTrigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary> 